import { mutationHandler } from "./mutationHandler"
import { isObject } from '../shared/utils'

export function useReactive (target) {
  return createReactObject(target, mutationHandler)
}

export function createReactObject(target, baseHandler) {
  console.log(target)
  if(!isObject(target)) {
    return target
  }

  const proxyObj = new Proxy(target, baseHandler)

  return proxyObj
}